package com.mage.mapper;

import com.mage.model.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

public interface UserMapper {

    public int insert(User user);

    @Delete("delete from t_user where id = #{userId}")
    public int delete(@Param("userId") Integer userId);

    public int update(User user);

    @Select("select * from t_user where id = #{userId}")
    public User findById(@Param("userId") Integer userId);

    @Select("select * from t_user")
    public List<User> find();

}
